<?php
$this->breadcrumbs=array(
	Yii::t('yii','Message')=>array('/msg'),
	Yii::t('yii','List')
);
?>

<?php $this->pageTitle=Yii::app()->name . ' - Messages'; ?>

<div style="height:35px;display:inline;"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/newmsg.png" alt="New" style="margin-bottom:-5px;"/><span style="font-size:20px;"><b><?php echo CHtml::link('Изпрати съобщения',array('msg/send')); ?></b></span></div>
<br/><br/>
<h1>Съобщения</h1>
<br/>
<h2>Нови съобщения</h2>
<?php if($new): ?>
<?php $this->beginWidget('CHtmlPurifier'); ?>
<?php foreach($new as $newmsg): ?>
<p><img src="/images/msg.png" style="margin-bottom:-10px;"/>&nbsp;&nbsp;&nbsp;<b><? echo CHtml::link($newmsg->subject,array('msg/read','id'=>$newmsg->id,'sid'=>md5($newmsg->subject))); ?></b> - от <?php echo CHtml::link($newmsg->sender->username,array('site/user','id'=>$newmsg->sender->id)); ?><br/></p>
<?php endforeach; ?>
<?php $this->endWidget(); ?>
<?php else: ?>
<b>Няма нови съобщения.</b>
<?php endif; ?>

<h2>Получени съобщения</h2>
<?php $this->beginWidget('CHtmlPurifier'); ?>
<?php if(!$received){echo 'Няма получени съобщения'; }?>
<?php foreach($received as $newmsg): ?>
<p><img src="/images/msg.png" style="margin-bottom:-10px;"/>&nbsp;&nbsp;&nbsp;<b>
<? echo CHtml::link($newmsg->subject,array('msg/read','id'=>$newmsg->id,'sid'=>md5($newmsg->subject))); ?>
</b> - от <?php echo CHtml::link($newmsg->sender->username,array('site/user','id'=>$newmsg->sender->id)); ?><br/></p>
<?php endforeach; ?>
<?php $this->endWidget(); ?>

<h2>Изпратени съобщения</h2>
<?php $this->beginWidget('CHtmlPurifier'); ?>
<?php if(!$sended){echo 'Няма изпратени съобщения.'; }?>
<?php foreach($sended as $newmsg): ?>
<p><img src="/images/msg.png" style="margin-bottom:-10px;"/>&nbsp;&nbsp;&nbsp;<b><? echo CHtml::link($newmsg->subject,array('msg/read','id'=>$newmsg->id,'sid'=>md5($newmsg->subject))); ?></b> - до <?php echo CHtml::link($newmsg->recever->username,array('site/user','id'=>$newmsg->recever->id)); ?><br/></p>
<?php endforeach; ?>
<?php $this->endWidget(); ?>

